import request from '@/config/axios'

export interface MemoryStatVO {
  id: number
  port: string
  memory: string
  pid: string
}

// 查询内存信息列表
export const getMemoryStatPage = async (params) => {
  return await request.get({ url: `/sca/memory-stat/page`, params })
}

// 查询内存信息详情
export const getMemoryStat = async (id: number) => {
  return await request.get({ url: `/sca/memory-stat/get?id=` + id })
}

// 新增内存信息
export const createMemoryStat = async (data: MemoryStatVO) => {
  return await request.post({ url: `/sca/memory-stat/create`, data })
}

// 修改内存信息
export const updateMemoryStat = async (data: MemoryStatVO) => {
  return await request.put({ url: `/sca/memory-stat/update`, data })
}

// 删除内存信息
export const deleteMemoryStat = async (id: number) => {
  return await request.delete({ url: `/sca/memory-stat/delete?id=` + id })
}

// 导出内存信息 Excel
export const exportMemoryStat = async (params) => {
  return await request.download({ url: `/sca/memory-stat/export-excel`, params })
}
